package com.inspinia.message.common.model;


import com.inspinia.base.common.model.NameCodeEnum;

/**
 * 推送类型
 * @author Veblen
 */

public enum NoticeAddresseeType implements NameCodeEnum {

    all(1, "所有人"),
    org(2, "机构"),
    dept(3, "部门"),
    role(4, "角色"),
    personal(5, "个人");

    private final int code;
    private final String name;

    NoticeAddresseeType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getName() {
        return this.name;
    }

    public static NoticeAddresseeType valueOf(int code) {
        for (NoticeAddresseeType rs : NoticeAddresseeType.values()) {
            if (rs.getCode() == code) {
                return rs;
            }
        }
        return null;
    }


}

